<template>
  <div class="community">
    <!-- 标题 -->
    <van-nav-bar title="标题" />
    <!-- 添加按钮 -->
    <div class="add"></div>
    <!-- 刷新组件 -->
    <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
      <!-- sildeList 组件 -->
      <div class="sildeList">
        <ul>
          <li>
            <span>关于跳绳, 我想说</span>
            <span>3769人围观</span>
            <span><img src="" alt=""></span>
          </li>
          <li>
            <span>有效到犯规的好课</span>
            <span>2.4万人围观</span>
            <span><img src="" alt=""></span>
          </li>
          <li></li>
          <li></li>
          <div>
            <span id="tip">全部话题</span>
          </div>
        </ul>
      </div>
    <div class="ShareCircle">
      <ul>
        <li>
        <share-part></share-part><!-- 分享动态组件 -->
        </li>
        <li>
        <share-part></share-part><!-- 分享动态组件 -->
        </li>
        <li>
        <share-part></share-part><!-- 分享动态组件 -->
        </li>
      </ul>
    </div>
    </van-pull-refresh>
  </div>
</template>
<script>
import SharePart from '../components/SharePart.vue'
import { Toast } from 'vant'
export default {
  name: 'ComtyView',
  data () {
    return {
      count: 0,
      isLoading: false
    }
  },
  components: {
    SharePart
  },
  methods: {
    onRefresh () {
      setTimeout(() => {
        Toast('刷新成功')
        this.isLoading = false
        this.count++
      }, 1000)
    }
  }
}
</script>
<style lang="less" scoped>
.sildeList::-webkit-scrollbar {
  display: none;
}
.sildeList {
  overflow: auto;
  width: 100%;
  height: 5rem;
  margin: auto;
  margin-top: 0.5rem;
  margin-left: 0.2rem;
  background-color: #f6f6f6;
  ul {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 300%;
    height: 5rem;
    li {
      position: relative;
      width: 15rem;
      height: 5rem;
      border-radius: 0.5rem;
      background-color: #fff;
      span {
        display: inline-block;
        position: absolute;
        width: 8rem;
        height: 1rem;
      }
      span:nth-child(1) {
        top: 1rem;
        left: 1rem;
      }
      span:nth-child(2) {
        top: 3.5rem;
        left: 1.5rem;
        font-size: 0.7rem;
      }
      span:nth-child(3) {
        top: 2.5rem;
        right: 2.5rem;
        img {
          display: inline-block;
          position: absolute;
          right: -2rem;
          top: -1.6rem;
          width: 3.5rem;
          height: 3.5rem;
          background-color: #f6f6f6;
          border-radius: 0.5rem;
        }
      }
    }
    div {
      position: relative;
      width: 7rem;
      height: 5rem;
      margin-right: 0.5rem;
      border-radius: 0.5rem;
      background-color: rgb(187, 24, 205);
      #tip {
        display: inline-block;
        position: absolute;
        width: 6rem;
        height: 1rem;
        top: 2rem;
        right: -0.5rem;
        color: #fff;
      }
    }
  }
}
.community {
  position: relative;
  width: 100%;
  height: 40rem;
  background-color: #f6f6f6;
}
.add {
  position: fixed;
  width: 3.3rem;
  height: 3.3rem;
  right: 1rem;
  bottom: 4rem;
  background-color: rgb(5, 177, 5);
  border-radius: 50%;
  z-index: 5;
}
.ShareCircle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 60rem;
  background-color: #ccc;
  margin-top: 0.5rem;
  ul {
    width: 100%;
  }
  ul li {
    width: 100%;
    height: 20rem;
    background-color: #f6f6f6;
    .share-part {
      width: 100%;
    }
  }
}
</style>
